package com.punch.user.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.punch.common.dto.user.teacher.TeacherAuditDTO;
import com.punch.common.dto.user.teacher.TeacherDTO;
import com.punch.common.dto.login.WXUserDTO;
import com.punch.common.model.LoginUser;
import com.punch.common.page.PageInfo;
import com.punch.common.query.user.teacher.TeacherQueryInfo;
import com.punch.common.vo.user.teacher.SimpleTeacherVO;
import com.punch.common.vo.user.teacher.TeacherPageVO;
import com.punch.common.vo.user.teacher.TeacherVO;
import com.punch.user.model.SysTeacher;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 教师信息表
 *
 * @author tanchangguo
 * @email 17607195327@163.com
 * @date 2020-07-21 19:10:02
 */
public interface TeacherService extends IService<SysTeacher> {

    /**
     * 教师分页
     *
     * @param queryInfo 查询条件
     * @return PageInfo<TeacherPageVO>
     */
    PageInfo<TeacherPageVO> queryPage(TeacherQueryInfo queryInfo);

    /**
     * 获取教师详情
     *
     * @param teacherId 老师id
     * @return TeacherVO
     */
    TeacherVO getTeacher(Long teacherId);

    /**
     * 新增教师
     *
     * @param teacherDTO 教师表单
     * @return teacherId
     */
    Long saveTeacher(TeacherDTO teacherDTO);

    /**
     * 修改教师信息
     *
     * @param teacherDTO 教师表单
     */
    void updateTeacher(TeacherDTO teacherDTO);

    /**
     * 删除教师
     *
     * @param teacherId 教师id
     */
    void deleteTeacher(Long teacherId);

    /**
     * 教师审核
     *
     * @param teacherAuditDTO 教师审核表单
     */
    void auditTeacher(TeacherAuditDTO teacherAuditDTO);

    /**
     * 教师下拉列表
     *
     * @param teacherName
     * @param teacherId
     * @return List<SimpleCourseVO>
     * @author xiaol
     * @since 2020/7/23
     */
    List<SimpleTeacherVO> listTeacherSelect(String teacherName, Long teacherId);

    /**
     * 教师启用/停用
     *
     * @param teacherId 教师id
     */
    void enableTeacher(Long teacherId);

    /**
     * 根据用openId获取用户教师信息
     *
     * @param openId 小程序openId
     * @return LoginUser
     */
    LoginUser getFeignTeacherByOpenId(String openId);

    /**
     * 根据手机号码获取用户信息
     *
     * @param mobile 手机号码
     */
    LoginUser getFeignTeacherByMobile(String mobile);

    /**
     * 进行注册,不存在则注册,存在则返回
     *
     * @param wxUserDTO 微信用户表单
     */
    boolean saveFeignTeacher(WXUserDTO wxUserDTO);

    /**
     * 教师导入
     *
     * @param file 文件
     * @return string
     */
    void importTeacher(MultipartFile file);

    /**
     * 获取教师审批失败信息
     *
     * @param teacherId 教师id
     * @return string
     */
    String getTeacherAuditMessage(Long teacherId);

    /**
     * 修改机构未审核状态下提交的教师
     *
     * @param userId 机构id
     */
    void updateUnAuditCommit(Long userId);


    void handlerTeacherArea();
}

